#include <iostream>

using namespace std;

int main() {
	string a, b;
	cin >> a >> b;
	
	if (a == b || (a == "Lynx" && (b == "Serval" || b == "Ocelot")) || (a == "Serval" && b == "Ocelot")) {
		cout << "Yes" << endl;
	} else {
		cout << "No" << endl;
	}
}